<template>
  <a-config-provider :locale="locale">
    <div id="app">
      <router-view />
    </div>
  </a-config-provider>
</template>
<script>
import zhCN from 'ant-design-vue/lib/locale-provider/zh_CN'
export default {
  name: 'App',
  data () {
    return {
      locale: zhCN
    }
  },
  methods: {
    // 刷新页面(刷新和离开页面都会走这个方法)
    refreshPage: function () {
      const currentPath = this.$router.history.current.path
      console.log(currentPath)
    }
  },
  mounted () {
    const that = this
    window.onbeforeunload = function (e) {
      that.refreshPage()
    }
  }
}
</script>
<style>
</style>
